Blood returning from the peripheral tissues to the heart has a relatively low concentration of oxygen, but is rich in carbon dioxide as a result of cellular metabolism. The deoxygenated blood returning to the heart is pumped from the right ventricle of the heart to the lungs and eventually enters the pulmonary capillaries surrounding the alveoli, as shown in the illustration on the right. Deoxygenated blood is represented by the purple red blood cells (RBCs) entering the capillary.

The intimate association of alveoli with capillaries facilitates exchange of oxygen and carbon dioxide between blood and inspired air inside the alveoli. Inspired air is a mixture of nitrogen (79%), oxygen (21%), carbon dioxide (0.03%), and a variety of other gases. Blood returning from the peripheral tissues to the heart has a relatively low concentration of oxygen, but is rich in carbon dioxide as a result of cellular metabolism. While oxygen only makes up 21% of inspired air, its concentration in deoxygenated blood is much lower. As a result, oxygen readily diffuses from the alveolus across the alveolar cells and into the capillary where it binds to hemoglobin in the red blood cells. The re-oxygenation of blood is depicted by the color shift in the RBCs from purple (deoxygenated blood) to red (oxygenated). Conversely, carbon dioxide, which is a by-product of cellular metabolism is relatively rich in blood returning from peripheral tissues, and it readily diffuses from capillary blood into the air in the alveolus, which is then exhaled.